#MAKEFILE
 
INCS = ./src/includes
BIN = ./bin
OBJS = ./obj
SRCS = ./src
CFLAGS = -Wall
LDFLAGS = -lcrypto -lssl
DEBUG = -g
CC = gcc

all: client_main server_main

new: clean client_main server_main

client_main: client.o
	$(CC) $(OBJS)/client.o $(OBJS)/utility.o -o $(BIN)/client_main $(CFLAGS) $(LDFLAGS)

server_main: server.o
	$(CC) $(OBJS)/server.o $(OBJS)/utility.o -o $(BIN)/server_main $(CFLAGS) $(LDFLAGS)

client.o: utility.o
	$(CC) $(DEBUG) -c $(SRCS)/client.c -o $(OBJS)/client.o
	
server.o: utility.o
	$(CC) $(DEBUG) -c $(SRCS)/server.c -o $(OBJS)/server.o
	
utility.o:
	$(CC) $(DEBUG) -c $(SRCS)/utility.c -o $(OBJS)/utility.o
	
clean:
	rm -f $(BIN)/* $(OBJS)/*